-
Notifications
You must be signed in to change notification settings - Fork 64
K8SPG-781 add original error #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
percona/watcher/wal.go
Outdated
@@ -167,6 +167,7 @@ func GetLatestCommitTimestamp(ctx context.Context, cli client.Client, execCli *c | |||
|
|||
primary, err := perconaPG.GetPrimaryPod(ctx, cli, cr) | |||
if err != nil { | |||
log.Error(err, "failed to get primary pod") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Jira ticket description, they are suggesting the wrapping of the error like that
errors.Wrap(err, PrimaryPodNotFound.Error())
Why aren't we wrapping the error, and instead we are adding logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: the clause you describe on the description can be modified to:
case errors.Is(errors.Cause(err), PrimaryPodNotFound) && localCr.Status.State != pgv2.AppStateReady:
Can you confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
commit: 43a3284 |
CHANGE DESCRIPTION
Problem:
We do not return original error if primary not found.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Logs were added.
For
GetLatestCommitTimestamp
log was added, since we use this error message in switch statement:CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability